package com.ftg.learn.theory.pattern;

/**
 * @author 布衣
 */
public class SqlProxyImpl implements SqlProxy{

    private SqlProxy sqlProxy;

    public SqlProxyImpl(SqlProxy sqlProxy) {
        this.sqlProxy = sqlProxy;
    }

    @Override
    public String createSelect() {
        return sqlProxy.createSelect()+" where id = ?";
    }

    public static void main(String[] args) {
        //select * from A
        SqlProxy sqlProxy = new SqlImple();
        System.out.println(sqlProxy.createSelect());

        SqlProxy s1 = new SqlProxyImpl(sqlProxy);

        System.out.println(s1.createSelect());

    }


}
